﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/AdminMasterPage.master"
    AutoEventWireup="true" CodeFile="WRUSERManager.aspx.cs" Inherits="Admin_Pages_WRUSER" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script language="javascript" type="text/javascript">
        Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(
        function () {
            if (document.getElementById) {
                var progress = document.getElementById('progress');
                var blur = document.getElementById('blur');
                progress.style.width = '300px';
                progress.style.height = '30px';
                blur.style.height = document.documentElement.clientHeight;
                progress.style.top = document.documentElement.clientHeight / 3 - progress.style.height.replace('px', '') / 2 + 'px';
                progress.style.left = document.body.offsetWidth / 2 - progress.style.width.replace('px', '') / 2 + 'px';
            }
        }
    )
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"><p></p>
    <h1><asp:Label ID="lbUsermanaget" runat="server" Text="<%$ Resources:AllSite,lbUsermanaget_userResource1 %>"></asp:Label></h1>
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                            </asp:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel" runat="server">
        <Triggers>
            <asp:PostBackTrigger ControlID="btnAdd"/>
            <asp:AsyncPostBackTrigger ControlID="btnBack" EventName="Click"/>
            <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click"/>
            <asp:AsyncPostBackTrigger ControlID="btnOk" EventName="Click"/>
            <asp:PostBackTrigger ControlID="btnUpload"/>
            <asp:PostBackTrigger ControlID="grvUser"/>
        </Triggers>
        <ContentTemplate>
            <asp:Panel runat="server" ID="pnShow">
                <div class="Control">
                    <ul>
                        <li>
                            <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,btnAdd_Resource1 %>" CssClass="vadd" ID="btnAdd" OnClick="btnAdd_Click"></asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,btnDelete_Resource1 %>" CssClass="vdelete" ID="btnDelete" OnClick="btnDelete_Click">Delete</asp:LinkButton>
                        </li>
                    </ul>
                </div>
                <asp:DataGrid runat="server" ID="grvUser" Width="100%" CssClass="TableView" AutoGenerateColumns="False"
                    AllowPaging="True" PageSize="9" PagerStyle-Mode="NumericPages" PagerStyle-HorizontalAlign="Center"
                    OnItemCommand="grvUser_ItemCommand" OnPageIndexChanged="grvUser_PageIndexChanged">
                    <HeaderStyle CssClass="trHeader"></HeaderStyle>
                    <ItemStyle CssClass="trOdd"></ItemStyle>
                    <AlternatingItemStyle CssClass="trEven"></AlternatingItemStyle>
                    <Columns>
                        <asp:TemplateColumn ItemStyle-CssClass="tdCenter">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkSelect" runat="server"></asp:CheckBox>
                            </ItemTemplate>
                            <ItemStyle CssClass="tdCenter"></ItemStyle>
                        </asp:TemplateColumn>
                        <asp:BoundColumn DataField="Id" HeaderText="Id" Visible="False" />
                        <asp:BoundColumn DataField="Name" HeaderText="<%$ Resources:AllSite,grName_userResource1 %>" ItemStyle-CssClass="Text" />
                        <asp:TemplateColumn HeaderText="<%$ Resources:AllSite,Avatar_userResource1 %>" ItemStyle-CssClass="Image">
                            <ItemTemplate>
                                <asp:Image ID="Image1" runat="server" ImageUrl='<%#Eval("Avatar") %>' Width="50"
                                    Height="50" />
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:BoundColumn DataField="Email" HeaderText="<%$ Resources:AllSite,grEmail_userResource1 %>" ItemStyle-CssClass="Text" />
                        <asp:BoundColumn DataField="BirthDay" HeaderText="<%$ Resources:AllSite,grBirthday_userResource1 %>" ItemStyle-CssClass="Time" />
                        <asp:BoundColumn DataField="CountryName" HeaderText="<%$ Resources:AllSite,grCountryName_userResource1 %>" ItemStyle-CssClass="Function" />
                        <asp:BoundColumn DataField="UserGroupName" HeaderText="<%$ Resources:AllSite,grUserGroupName_userResource1 %>" ItemStyle-CssClass="Function" />
                        <asp:BoundColumn DataField="Active" HeaderText="<%$ Resources:AllSite,grActive_userResource1 %>" ItemStyle-CssClass="Active" />
                        <asp:TemplateColumn  ItemStyle-CssClass="Option">
                            <HeaderTemplate> 
                               <asp:Label ID="lbUsername" runat="server" Text="<%$ Resources:AllSite,grOption_userResource1 %>"></asp:Label> 
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnEdit" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>'
                                    CommandName="Edit" ImageUrl="~/Admin/Images/edit.png" ToolTip="<%$ Resources:AllSite,Update_Resource1 %>" />
                                |
                                <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"Id") %>'
                                    CommandName="Delete" ImageUrl="~/Admin/Images/delete.png" OnClientClick="return confirm('Are you sure?')"
                                    ToolTip="<%$ Resources:AllSite,Delete_Resource1 %>" />
                            </ItemTemplate>
                        </asp:TemplateColumn>
                    </Columns>
                    <PagerStyle HorizontalAlign="Center" CssClass="gridview" Position="Bottom" NextPageText="Previous"
                        PrevPageText="Next" Mode="NumericPages" Height="30"></PagerStyle>
                </asp:DataGrid>
            </asp:Panel>
            <asp:Panel runat="server" ID="pnUpdate">
                <div class="TableUpdate">
                    <!--IDUpdateBy va CreateDate-->
                    <div class="mainquoc" style="visibility: hidden">
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtID" runat="server" Visible="False"></asp:TextBox>
                        </div>
                    </div>
                    <div style="padding: 0px 0px 0px 30px">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="BulletList"
                HeaderText="You must enter a value in the following fields:" ForeColor="red" EnableClientScript="True"/>
            </div>
                    <!--end IDUpdateBy va CreateDate-->
                    <!--username va password-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbUsername" runat="server" Text="<%$ Resources:AllSite,lbUsername_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtUsername" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ErrorMessage="Username is required" Text="(*)" 
                    ControlToValidate="txtUsername" ForeColor="red"></asp:RequiredFieldValidator>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbPassword" runat="server" Text="<%$ Resources:AllSite,lbPassword_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtPassword" runat="server" CssClass="text" TextMode="Password"  MaxLength="50"></asp:TextBox>
                            <%--<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ErrorMessage="Password is required" Text="(*)" 
                    ControlToValidate="txtPassword" ForeColor="red"></asp:RequiredFieldValidator>--%>
                        </div>
                    </div>
                    <!--end username va password-->
                    <!--Firstname va Lastname-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbFirstname" runat="server" Text="<%$ Resources:AllSite,lbFirstname_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtFirstname" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ErrorMessage="Firstname is required" Text="(*)" 
                    ControlToValidate="txtFirstname" ForeColor="red"></asp:RequiredFieldValidator>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbLastname" runat="server" Text="<%$ Resources:AllSite,lbLastname_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtLastname" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ErrorMessage="Lastname is required" Text="(*)" 
                    ControlToValidate="txtLastname" ForeColor="red"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <!--end Firstname va Lastname-->
                    <!--BirthDay va Email-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbBirthDay" runat="server" Text="<%$ Resources:AllSite,lbBirthDay_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtBirthday" runat="server" CssClass="date"></asp:TextBox>
                            <asp:CalendarExtender ID="CalBirthday" runat="server" Format="dd/MM/yyyy" TargetControlID="txtBirthday"
                                PopupButtonID="ibtCal">
                            </asp:CalendarExtender>
                            <asp:ImageButton ID="ibtCal" runat="server" Height="18px" ImageUrl="~/Images/Icon/cal.png"
                                Width="18px" OnClick="ibtCal_Click" ImageAlign="AbsMiddle" CausesValidation="False" />
                            <%--<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
                            </asp:ToolkitScriptManager>--%>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbEmail" runat="server" Text="<%$ Resources:AllSite,lbEmail_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtEmail" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ErrorMessage="Email is required" Text="(*)" 
                    ControlToValidate="txtEmail" ForeColor="red"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <!--end BirthDay va Email-->
                    <!--Address va Phone-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbAddress" runat="server" Text="<%$ Resources:AllSite,lbAddress_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtAddress" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbPhone" runat="server" Text="<%$ Resources:AllSite,lbPhone_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtPhone" runat="server" CssClass="text" MaxLength="20"></asp:TextBox>
                        </div>
                    </div>
                    <!--end Address va Phone-->
                    <!--RsPssQuestion va RsPssAnswer-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbRsPssQuestion" runat="server" Text="<%$ Resources:AllSite,lbRsPssQuestion_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtRsPssQuestion" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbRsPssAnswer" runat="server" Text="<%$ Resources:AllSite,lbRsPssAnswer_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtRsPssAnswer" runat="server" CssClass="text" MaxLength="50"></asp:TextBox>
                        </div>
                    </div>
                    <!--end RsPssQuestion va RsPssAnswer-->
                    <!--IDCitizen va IDUserGroup-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbIDCitizen" runat="server" Text="<%$ Resources:AllSite,lbIDCitizen_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:DropDownList ID="ddlCitizen" runat="server" CssClass="dropdown">
                            </asp:DropDownList>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbIDUserGroup" runat="server" Text="<%$ Resources:AllSite,lbIDUserGroup_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:DropDownList ID="ddlUserGroup" runat="server" CssClass="dropdown">
                            </asp:DropDownList>
                        </div>
                    </div>
                    <!--end IDCitizen va IDUserGroup-->
                    <!--IP va Active-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbIP" runat="server" Text="<%$ Resources:AllSite,lbIP_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtIP" runat="server" CssClass="text" MaxLength="20"></asp:TextBox>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbActive" runat="server" Text="<%$ Resources:AllSite,lbActive_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:DropDownList ID="ddlActive" runat="server" CssClass="dropdown">
                                <asp:ListItem>Y</asp:ListItem>
                                <asp:ListItem>N</asp:ListItem>
                            </asp:DropDownList>
                        </div>
                    </div>
                    <!--end IP va Active-->
                    <!--Description va Avatar-->
                    <div class="mainquoc">
                        <div class="quoclable">
                            <asp:Label ID="lbDescription" runat="server" Text="<%$ Resources:AllSite,lbDescription_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:TextBox ID="txtDescription" TextMode="MultiLine" runat="server" CssClass="text"></asp:TextBox>
                        </div>
                        <div class="quoclable">
                            <asp:Label ID="lbAvatar" runat="server" Text="<%$ Resources:AllSite,lbAvatar_userResource1 %>"></asp:Label>
                        </div>
                        <div class="quocinput_detail">
                            <asp:FileUpload ID="FileUpload1" runat="server" />&nbsp;
                            <asp:Button ID="btnUpload" runat="server" Text="<%$ Resources:AllSite,btnUpload_userResource1 %>" Height="22" OnClick="btnUpload_Click" CausesValidation="False" />
                        </div>
                    </div>
                    <!--end Description va Avatar-->
                </div>
                <div class="Control">
                    <ul>
                        <li>
                            <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,Update1_Resource1 %>" CssClass="uupdate" ID="btnOk" OnClick="btnOk_Click"></asp:LinkButton>
                        </li>
                        <li>
                            <asp:LinkButton runat="server" Text="<%$ Resources:AllSite,Back1_Resource1 %>" CssClass="uback" ID="btnBack" 
                                OnClick="btnBack_Click" CausesValidation="False"></asp:LinkButton>
                        </li>
                    </ul>
                </div>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress" runat="server">
        <ProgressTemplate>
            <div id="progress">
                    <asp:Image ID="Image2" runat="server" ImageUrl="~/Admin/Images/loading6.gif"/>
                </div>
            <div id="blur" />
        </ProgressTemplate>
    </asp:UpdateProgress>
</asp:Content>
